#include "user_extern.h"

static uint16_t subidx = 0;
static uint8_t init_tag = 0;

unsigned char digimon_database_bmp[1][48][6] = {0}; /* only one bmp */
/****************************************
 *  名称： system_digimon_show_time
 *  功能： digimon 显示时间界面
 *  参数： 
 *  返回值：DIGI_VOID
 ****************************************/
uint8_t digi08_database_display(void)
{
    oled.show_number(0,0,subidx, 3, STR_SIZE_16, 1);
    oled.show_string(0,18,T(digimon_libs[subidx].digi_name), STR_SIZE_16, 1);

    if (init_tag == 0)
    {
        system_get_digimon_by_id(subidx, &digimon_database_bmp);
        init_tag = 1;
    }
    uint8_t win_ret = WINDOWS_STATUS_DIS_ONLY;
    system_digimon_dataBase(&digimon_database_bmp);
    return win_ret;
}

uint8_t digi08_database_btn_select(void *arg)
{
    subidx++;
    init_tag = 0;
    return 0;
}

uint8_t digi08_database_btn_enter(void *arg)
{
    subidx--;
    init_tag = 0;
    return 0;
}

uint8_t digi08_database_btn_exit(void *arg)
{
    Dsystem.windows_cur_id = WIN_UI_DIGIMON;
    return WINDOWS_STATUS_INIT;
}
